home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 152 / tedinfom.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-21  |  2.4 KB  |  64 lines

  1. #include <aesbind.h>
  2. #include <obdefs.h>
  3. #include <gemdefs.h>
  4. #define SPEC 0x510f1L
  5. #define B1FLAGS  0x5
  6. #define B2FLAGS  0x7
  7.  
  8. char input[] = "....................";
  9. char template[] = "Your Name:____________________";
  10. char check[] = "XXXXXXXXXXXXXXXXXXXX";
  11. char button1[] = "Ok";
  12. char button2[] = "GEM";
  13.  
  14. TEDINFO text[] = {
  15. /* text pointer(@ for none)
  16. *  |       template pointer
  17. *  |       |        validate pointer
  18. *  |       |        |     font code character
  19. *  |       |        |     |   any int
  20. *  |       |        |     |   |     justification code character
  21. *  |       |        |     |   |     |       color code
  22. *  |       |        |     |   |     |       |    any int
  23. *  |       |        |     |   |     |       |    |  border thickness(rasters)
  24. *  |       |        |     |   |     |       |    |  |   input string(char)
  25. *  |       |        |     |   |     |       |    |  |   |   template str(char)
  26. *  v       v        v     v   v     v       v    v  v   v   v               */
  27.  input, template, check, IBM, 1, TE_CNTR, WHITE, 5, 1, 21, 34
  28. };
  29.  
  30. OBJECT dialogue[] = {                     /* set up for hirez screen */
  31. /*next/head/tail/   type/   flags/   state/    spec./  X/  Y/  W/  H */
  32.     -1,  1,  3,    G_BOX,    NONE,  NORMAL,    SPEC,   0,  0,600,125,
  33.      2, -1, -1,  G_FTEXT,EDITABLE,  NORMAL,    text, 100, 25,400, 50,
  34.      3, -1, -1, G_BUTTON, B1FLAGS,  NORMAL, button1, 230,100, 40, 10,
  35.      0, -1, -1, G_BUTTON, B2FLAGS,  NORMAL, button2, 300,100, 40, 10
  36. };
  37. Rect tempbox  = { 0, 0, 0, 0 };
  38. Prect tempptr = { &tempbox.x, &tempbox.y, &tempbox.w, &tempbox.h };
  39. main()
  40. {
  41.         int nowhere = 0;
  42.         int quit;
  43.         char newstring[34] = "Your name is ";
  44.         appl_init();
  45.         graf_mouse(ARROW, &nowhere);
  46.         form_center(dialogue, tempptr);
  47.         objc_draw(dialogue, ROOT, MAX_DEPTH, tempbox);
  48.         for(;;)
  49.         {
  50.                 quit = form_do(dialogue, 1);
  51.                 if (quit == 2)
  52.                 {
  53.                         strcat(newstring, input);
  54.                         strcpy(template, newstring);
  55.                         objc_draw(dialogue, ROOT, MAX_DEPTH, tempbox);
  56.                 }
  57.                 if (quit == 3 )
  58.                 {
  59.                         appl_exit();
  60.                         exit(0);
  61.                 }
  62.         }     /* typed in as stated in MWC ; not yet exactly usable, yet */
  63. }                              /* MWC pp. 361-362 6Jun'87 CJPurcell */
  64.